﻿<%@ Page Title="Níveis de Titulação" Language="C#" MasterPageFile="~/Site.Master"
    AutoEventWireup="true" CodeBehind="CadastroNivelTitulacao.aspx.cs" Inherits="AcadPosApp.Cadastros.CadastroNivelTitulacao" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <style type="text/css">
        .style2
        {
            width: 142px;
        }
        .style3
        {
            width: 143px;
        }
        .style5
        {
            width: 145px;
        }
        .style6
        {
            width: 87px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Panel ID="pnlConsulta" runat="server" GroupingText="Consulta de Níveis de Titulação">
        <table class="form-inline">
            <tr>
                <td class="style2">
                    <asp:Label ID="Label1" runat="server" Text="Descrição"></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtPesquisa" required="required" runat="server" Width="300px" MaxLength="50"></asp:TextBox>
                </td>
                <td>
                    <br />
                    &nbsp;&nbsp;
                    <asp:Button ID="btnConsultar" runat="server" Text="Consultar" 
                        OnClick="btnConsultar_Click" Width="100px" />
                </td>
            </tr>
        </table>
        <br />
        <asp:GridView ID="gvwNiveisTitulacao" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            CssClass="mGrid" DataKeyNames="ID_NIVEL_TITULACAO" EmptyDataText="Dados não localizados..."
            GridLines="Vertical" OnPageIndexChanging="gvwNiveisTitulacao_PageIndexChanging"
            OnRowCreated="gvwNiveisTitulacao_RowCreated" OnRowDataBound="gvwNiveisTitulacao_RowDataBound"
            Width="45%" OnRowCommand="gvwNiveisTitulacao_RowCommand">
            <AlternatingRowStyle BackColor="#D3D3D3" />
            <Columns>
                <asp:TemplateField HeaderText="Editar" ShowHeader="False">
                    <ItemTemplate>
                        <abbr title="Editar!">
                            <asp:ImageButton ID="ImgAlterar" runat="server" CausesValidation="false" CommandName="Alterar"
                                formnovalidate="formnovalidate" ImageUrl="~/Imagens/edit.png" Text="Alterar"
                                Width="20px" />
                        </abbr>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Excluir" ShowHeader="False">
                    <ItemTemplate>
                        <abbr title="Excluir!">
                            <asp:ImageButton ID="ImgExcluir" runat="server" CausesValidation="false" CommandName="Excluir"
                                formnovalidate="formnovalidate" ImageUrl="~/Imagens/delete.png" OnClientClick="return ShowConfirm('Tem certeza que deseja excluir?', this.ID);"
                                Text="Excluir" Width="20px" />
                        </abbr>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:TemplateField>
                <asp:BoundField DataField="NIVEL" HeaderText="Níveis">
                    <ItemStyle HorizontalAlign="Left" Width="80%" />
                </asp:BoundField>
                <asp:BoundField DataField="SIGLAF" HeaderText="Sigla F.">
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>                
                <asp:BoundField DataField="SIGLAM" HeaderText="Sigla M.">
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Status">
                    <ItemTemplate>
                        <asp:Image ID="imgStatus" runat="server" Height="25px" Width="25px" />
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                <asp:BoundField DataField="SITUACAO" HeaderText="Status">
                    <ItemStyle HorizontalAlign="Center" Width="25%" />
                </asp:BoundField>
            </Columns>
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#808080" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        </asp:GridView>
        <div class="legenda">
            <asp:Button ID="btnInserir" formnovalidate runat="server" Text="Inserir" 
                OnClick="btnInserir_Click" Width="100px" />
        </div>
        <br />
    </asp:Panel>
    <br />
    <asp:Panel ID="pnlCadastro" runat="server" GroupingText="Cadastro de Níveis de Titulação"
        Visible="False">
        <table class="form-inline">
            <tr>
                <td class="style3" colspan="2">
                    <asp:Label ID="Label2" runat="server" Text="Descrição"></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtDescricao" required runat="server" Width="300px" MaxLength="50"
                        pattern="^((.)(?!\2{3,}))+$" title="Somente são permitidos 3 caracteres iguais e consecutivos.">
                    </asp:TextBox>
                </td>
                <td>
                    <asp:Label ID="Label3" runat="server" Text="Situação"></asp:Label>
                    <br />
                    &nbsp;&nbsp;
                    <asp:DropDownList ID="ddlSituacao" runat="server" Width="120px" 
                        style="margin-left: 0px">
                        <asp:ListItem Value="A">Ativo</asp:ListItem>
                        <asp:ListItem Value="I">Inativo</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="style6">
                    <asp:Label ID="Label4" runat="server" Text="Sigla F."></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtSiglaF" required runat="server" Width="100px" MaxLength="5"></asp:TextBox>
                </td>
                <td class="style5">
                    <asp:Label ID="Label5" runat="server" Text="Sigla M."></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtSiglaM" required runat="server" Width="100px"></asp:TextBox>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </table>
        <br />
        <div class="legenda">
            <asp:Button ID="btnConfirmar" runat="server" Text="Confirmar" 
                OnClick="btnConfirmar_Click" Width="100px" />
            &nbsp;<asp:Button ID="btnCancelar" formnovalidate runat="server" 
                Text="Cancelar" OnClick="btnCancelar_Click" Width="100px" />
        </div><br />
    </asp:Panel>
</asp:Content>
